﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StudentManagerPro.Common
{
    public class Global
    {

        /// <summary>
        /// 0 没有用于登录  1 有用户登录
        /// </summary>
        public static LoginState LoginState = LoginState.UserLoginNot;
        /// <summary>
        /// 登录用户
        /// </summary>

        private static string _user = string.Empty;
        public static string user
        {
            get => _user; 
            set
            {
                _user = value;
                UserChange?.Invoke();
            }
        }
        public static event Action UserChange;
        /// <summary>
        /// 当前用户登录密码
        /// </summary>
        public static  string Password { get; set; }

    }

    public enum LoginState
    {
        UserLoginNot,
        UserLoginSucess
    }
}
